Component({
    properties: {
        cancelText: {
            type: String,
            value: "取消"
        },
        confirmText: {
            type: String,
            value: "确定"
        }
    },
    data: {
        reasonIndex: "0",
        cancelReasonArr: [ {
            v: "0",
            t: "请选择取消原因"
        }, {
            v: "11",
            t: "我不小心订错了课"
        }, {
            v: "12",
            t: "我的日程安排有冲突导致无法上课"
        }, {
            v: "13",
            t: "我不想再和这个教师/学生上课"
        }, {
            v: "14",
            t: "个人原因"
        }, {
            v: "100",
            t: "其他"
        } ]
    },
    ready: function(e) {
        if (!this.selectComponent) throw new Error("小程序sdk暂不支持节点操作selectComponent");
        this.baseModal = this.selectComponent("#baseModal");
    },
    methods: {
        show: function() {
            this.triggerEvent("scrollEvent", {
                noScroll: !0
            }), this.baseModal.showModal();
        },
        hide: function() {
            this.triggerEvent("scrollEvent", {
                noScroll: !1
            }), this.baseModal.hideModal();
        },
        bindPickerChange: function(e) {
            var t = Number(e.detail.value);
            this.setData({
                reasonIndex: t,
                problem_reason: this.data.cancelReasonArr[t].v,
                showReasonError: !1
            });
        },
        _cancelModal: function() {
            this.hide(), this.triggerEvent("cancelEvent");
        },
        bindTextAreaBlur: function(e) {
            void 0 !== e.detail.value && this.setData({
                problem_msg: e.detail.value
            });
        },
        _confirmModal: function(e) {
            this.triggerEvent("confirmEvent", {
                problem_msg: this.data.problem_msg,
                problem_reason: this.data.problem_reason
            }), "0" !== this.data.reasonIndex ? this.hide() : this.setData({
                showReasonError: !0
            }), this.setData({
                problem_msg: ""
            });
        }
    }
});